/**
 *  产品
 * @auther jiagnqifan
 * @since 2016-03-31
 */
var mongoose  = require('mongoose');
var BaseModel = require("./base_model");
var Schema    = mongoose.Schema;

var ProductSchema = new Schema({

    config:{
      type: Schema.Types.ObjectId,
      ref: 'ProductConfig'
    },

    version:{
      type: String,
      required: true
    },

    url:{
      type: String,
      required: true
    },

    timestamp:{
      type: Date,
      default: Date.now
    }
    ,
    create_at: { type: Date, default: Date.now },
    update_at: { type: Date, default: Date.now }
});

ProductSchema.plugin(BaseModel);
module.exports = mongoose.model('Product', ProductSchema);
